﻿@model S4Store.Models.Markting.WLMTModel
@{
    Layout = null;
    ViewBag.Title = "WLMT";

    S4Store.Models.Chart.Column ChartModel = new S4Store.Models.Chart.Column();
    //ChartModel.Name = "网络集客效果KPI概况";
    ChartModel.YAxis = "单位(万元)";
    ChartModel.XAxis.Add("单位(万元)");
    
    ChartModel.Colors = new List<string> { S4Store.Models.Chart.Color.Target, S4Store.Models.Chart.Color.Actual };
    
    S4Store.Models.Chart.ChartSeries series1 = new S4Store.Models.Chart.ChartSeries();
    series1.Name = "网电营销月度预算";
    series1.Data.Add(Model.StoreReport.NetMarketingKpiMonthConfig.YDYS);
    ChartModel.Serieses.Add(series1);
    
    S4Store.Models.Chart.ChartSeries series2 = new S4Store.Models.Chart.ChartSeries();
    series2.Name = "网店营销实际投入";
    series2.Data.Add(Model.StoreReport.YDFY);
    ChartModel.Serieses.Add(series2);
    
    
    ChartModel.IsRate = false;
    List<S4Store.Models.Chart.RedGreenIndex> RedGreenIndexs = new List<S4Store.Models.Chart.RedGreenIndex>();
    S4Store.Models.Chart.RedGreenIndex index1 = new S4Store.Models.Chart.RedGreenIndex();
    index1.Size = S4Store.Models.Chart.RedGreenIndex.IndexSize.Middle;
    if (Model.StoreReport.YDFY >= Model.StoreReport.NetMarketingKpiMonthConfig.YDYS)
    {
        index1.Type = S4Store.Models.Chart.RedGreenIndex.IndexType.Green;   
    }else{
        index1.Type = S4Store.Models.Chart.RedGreenIndex.IndexType.Red;   
    }
    index1.Value = (Model.StoreReport.YDFY - Model.StoreReport.NetMarketingKpiMonthConfig.YDYS).toInt();
    index1.Url = Url.Action("WZXJB");
    index1.Title = "实际投入与月度预算的差值";
    index1.Tip = "网络集客性价比概况";
    RedGreenIndexs.Add(index1);


    S4Store.Models.Chart.Column ChartModel2 = new S4Store.Models.Chart.Column();
    ChartModel2.YAxis = "进度(%)";
    foreach(var report in Model.MediaReports){
        ChartModel2.XAxis.Add(report.Media.Name);
    }
    series1 = new S4Store.Models.Chart.ChartSeries();
    series1.Name = "时间进度";
    foreach (var report in Model.MediaReports)
    {
        series1.Data.Add(report.RateOfTime);
    }
    ChartModel2.Serieses.Add(series1);
    series2 = new S4Store.Models.Chart.ChartSeries();
    series2.Name = "集客进度";
    foreach (var report in Model.MediaReports)
    {
        series2.Data.Add(report.JKJD);
    }
    ChartModel2.Serieses.Add(series2);

    List<S4Store.Models.Chart.RedGreenIndex> RedGreenIndexs2 = new List<S4Store.Models.Chart.RedGreenIndex>();
    foreach (var report in Model.MediaReports)
    {
        S4Store.Models.Chart.RedGreenIndex index = new S4Store.Models.Chart.RedGreenIndex();
        index.Size = S4Store.Models.Chart.RedGreenIndex.IndexSize.Middle;
        if (report.JKJDDiff >= 0)
        {
            index.Type = S4Store.Models.Chart.RedGreenIndex.IndexType.Green;
        }
        else
        {
            index.Type = S4Store.Models.Chart.RedGreenIndex.IndexType.Red;
        }
        index.Value = (report.JKJDDiff).toInt()+"%";
        index.Url = Url.Action("JKXG", new { MediaId = report.Media.Id });
        index.Title = "当日客户资源获取总数与应时获取信息目标的差值";
        index.Tip = "汽车网站集客效果KPI";
        RedGreenIndexs2.Add(index);
    }
}
<div style="height:100%; overflow:auto">
@Html.Action("ReportBar", "Common", Model.BarModel)
<div style="position:relative; width:100%">
      <div style="width:300px; display:inline-block">
        @Html.Partial("../Chart/Column", ChartModel)
        @Html.Partial("../Chart/RedGreenIndex", RedGreenIndexs)
      </div>
      <div style="width:700px; display:inline-block">
        @Html.Partial("../Chart/Column", ChartModel2)
        @Html.Partial("../Chart/RedGreenIndex", RedGreenIndexs2)
      </div>
</div>
</div>


